<template>
  <div class="likes">
    <slot name="likename"></slot>
    <div class="goodslist">
      <div
        class="goods"
        v-for="(v, i) in goodsstr"
        :key="i"
        @click="likefun(v.id)"
      >
        <img :src="v.img" alt="" />
        <p class="title">{{ v.title }}</p>
        <span>{{ v.miaoshu }}</span>
        <p class="pp">￥{{ v.price }}</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["goodsstr"],
  methods: {
    likefun(ids) {
      this.$router.push({ name: "likexq", params: { id: ids } });
    },
  },
};
</script>

<style scoped>
.likes {
  width: 95%;
}
.goodslist {
  width: 100%;
  min-height: 3rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}
.goods {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 48%;
  height: 2.8rem;
  background-color: #fff;
  flex-shrink: 0;
  border-radius: 0.1rem;
  margin-bottom: 0.14rem;
}
.goods img {
  width: 1.73rem;
  height: 1.73rem;
}
.title {
  font-size: 0.14rem;
  margin-left: 0.1rem;
}
.goods .pp {
  font-size: 0.15rem;
  color: #c03131;
  margin-left: 0.1rem;
}
.goods span {
  font-size: 0.12rem;
  color: #797d82;
  margin-left: 0.1rem;
}
</style>